package org.hqs.feign.clients;

import org.hqs.feign.common.JsonResult;
import org.hqs.feign.pojo.Arrangement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "arrangementservice")
public interface ArrangementClient {

    @GetMapping("/arrangement/")
    public JsonResult<List<Arrangement>> getAllArrangements();

    @GetMapping("/arrangement/{id}")
    public JsonResult<Arrangement> getArrangementById(@PathVariable int id);

    @PostMapping("/arrangement/")
    public JsonResult insertArrangement(@RequestBody Arrangement arrangement);

    @PutMapping("/arrangement/{id}")
    public JsonResult updateArrangement(@PathVariable int id, @RequestBody Arrangement arrangement);

    @DeleteMapping("/arrangement/{id}")
    public JsonResult deleteArrangementById(@PathVariable int id);

    @GetMapping("/arrangement/find_by_clinic_id/{id}")
    public JsonResult<List<Arrangement>> findByClinicId(@PathVariable int id);
}
